import { CoachProps } from "../../utils/type"

Component({

  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object,
      value: {},
      observer(newVal, oldVal) {
        this.setData({
          coach: newVal as CoachProps
        })
      }
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    coach: <CoachProps>{},
    themeCode:''
  },
  lifetimes: {
    attached() {
      //从本地获取当前选择的城市编码
      this.setData({
        themeCode: wx.getStorageSync('themeCode')
      })
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onOpenPage() {
      wx.setStorageSync('coach', this.data.coach)
      wx.navigateTo({
        url: '../../../pages/drivingSchool/coach/coach'
      })
    }
  }
})